﻿function HideMenuToolbar() {
    $("#toolbar").fadeOut();
    $("#toolbarbutton").fadeIn("slow");
}

function ShowMenuToolbar() {
    $("#toolbar").fadeIn();
    $("#toolbarbutton").fadeOut("slow");
}
$(document).ready(function () {
    $("span.hidebar a").click(function () {
        HideMenuToolbar();
        Set_Cookie('openstate', 'closed')
    });
    $("span.showbar a").click(function () {
        ShowMenuToolbar();
        Set_Cookie('openstate', 'open')
    });
    $("span.hidebar a, span.showbar a").click(function () {
        return false;
    });
    var openState = Get_Cookie('openstate');
    if (openState != null) {
        if (openState == 'closed') {
            HideMenuToolbar();
        }
        if (openState == 'open') {
            ShowMenuToolbar();
        }
    }
});